package com.xmg.server.goods.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xmg.server.goods.mapper.CatalogPropertyValueMapper;
import com.xmg.shop.api.domain.CatalogPropertyValue;
import com.xmg.shop.api.service.ICatalogPropertyValueService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class CatalogPropertyValueServiceImpl implements ICatalogPropertyValueService {
    @Autowired
    private CatalogPropertyValueMapper catalogPropertyValueMapper;

    @Override
    public List<CatalogPropertyValue> selectByPropertyId(Long propertyId) {
        return catalogPropertyValueMapper.selectByPropertyId(propertyId);
    }

    @Override
    public int save(CatalogPropertyValue catalogPropertyValue) {
        return catalogPropertyValueMapper.insert(catalogPropertyValue);
    }

    @Override
    public int delete(Long id) {
        return catalogPropertyValueMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteByPropertyId(Long propertyId) {
        return catalogPropertyValueMapper.deleteByPropertyId(propertyId);
    }
}
